<%@ tag import="org.internna.iwebmvc.spring.jee.IWebMvcCombinedFilter" %>
<%@ tag description="Allows creation of a IWebJTracker issue" pageEncoding="ISO-8859-1" %>
<%@ taglib prefix="iwebmvc" uri="http://tags.iwebmvc.com" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt" %>
<%@ attribute name="issueClass" type="java.lang.Class" required="true" %>
<%@ attribute name="projectClass" type="java.lang.Class" required="true" %>
<%@ attribute name="versionClass" type="java.lang.Class" required="true" %>
<%@ attribute name="moduleClass" type="java.lang.Class" required="true" %>
<c-rt:set var="subsession_id" value="<%= IWebMvcCombinedFilter.SUB_SESSION_COOKIE %>" />
<c-rt:set var="subsession_path" value="<%= IWebMvcCombinedFilter.SUB_SESSION_COOKIE_PATH %>" />
<c-rt:set var="sessionUser" value="<%= org.internna.iwebmvc.security.UserManager.SESSION_USER %>" />
<input type="hidden" id="newissueproject" name="newissueproject" />
<input type="hidden" id="newissueprojectalias" name="newissueprojectalias" />
<div>
    <span class="field">
        <iwebmvc:enum id="newissue" entityClass="${issueClass}" path="type" rows="10" onChange="changeIssueType(this)" />
    </span>
    <span class="field">
        <iwebmvc:enum id="newissue" entityClass="${issueClass}" path="severity" rows="10" />
    </span>
</div>
<div>
    <span class="field">
        <iwebmvc:locator id="newissuemodule" entityClass="${issueClass}" path="parentModule" rows="8" pages="5" currentDepthLevel="0" maxDepthLevel="1" baseColumnWidth="100" gridId="newissuemodule" />
    </span>
    <span class="field">
        <iwebmvc:locator id="newissueversion" entityClass="${issueClass}" path="affectedVersion" rows="8" pages="5" currentDepthLevel="0" maxDepthLevel="1" baseColumnWidth="100" gridId="newissueversion" />
    </span>
</div>
<div>
    <iwebmvc:textbox id="newissue" entityClass="${issueClass}" path="summary" textboxCssStyle="width:540px;" />
</div>
<div class="label" style="margin-top:5px"><iwebmvc:message argMessage="${issueClass.name}.description" /></div>
<div>
    <div id="newissuetextarea" name="top" class="border_${sessionScope[sessionUser].theme}" height="225" dojoType="dijit.Editor" style="height:225px;width:540px;"></div>
</div>
<div style="text-align:right;width:100%;position:absolute;right:15px;bottom:15px">
    <span id="issueValidationWarningContainer" class="validationWarning"></span>
    <span id="issueNewLoadingContainer" style="display:none"><img src='<c:url value="resource.iwebmvc?file=images/loading.gif" />&${requestScope[subsession_path]}=${requestScope[subsession_id]}' alt='' /></span>
    <iwebmvc:button buttonId="newissuecreate" label="ui.issues.new" buttonIcon="/resource.iwebmvc?file=/images/common/bug_${sessionScope[sessionUser].theme}.gif">
        createIssue(byId("newissueprojectalias").value, "${iwebmvc:inferDWRConvertedJavascriptClass(projectClass)}", "${iwebmvc:inferDWRConvertedJavascriptClass(issueClass)}", "${iwebmvc:inferDWRConvertedJavascriptClass(moduleClass)}", "${iwebmvc:inferDWRConvertedJavascriptClass(versionClass)}");
    </iwebmvc:button>
</div>